#!/bin/bash

PJHOME=/home/rota/workspace/AgriWap
OUTFILE=classes`date +%F`.tar.gz

cd $PJHOME/war/WEB-INF/
rm -f $PJHOME/$OUTFILE
tar cvzf $PJHOME/$OUTFILE classes/ *.xml *.properties

echo "Copying $PJHOME/$OUTFILE ..."
scp -i ~/.ssh/id_rsa.ami-f81967aa $PJHOME/$OUTFILE root@122.248.251.244:/tmp/

rm -f $PJHOME/$OUTFILE
echo ssh -i ~/.ssh/id_rsa.ami-f81967aa root@122.248.251.244
